//package com.example.workrecord.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.example.workrecord.config.WebLog;
//import com.example.workrecord.entity.AuthInfo;
//import com.example.workrecord.entity.CorpUserDetail;
//import com.example.workrecord.service.AuthHelper;
//import com.example.workrecord.util.Result;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
///**
//  *@ClassName: AuthController
//  *@Description 免登鉴权接口
//  *@Author Mr.Bu
//  *@Date 2020/4/26 11:22
//  *@Version: 1.0
//  */
//@RestController
//@Api(value = "auth", description = "免登鉴权接口", consumes = "application/json;charset=UTF-8")
//@RequestMapping(value = "/auth")
//public class AuthController extends BaseController {
//
//    @Autowired
//    private AuthHelper authHelper;
//
//
//    @PostMapping("/login")
//    @ResponseBody
//    @WebLog(description = "免登接口")
//    @ApiOperation(value = "免登接口，提交信息包含corpid与appkey", notes = "{}")
//    public Result login(@RequestBody JSONObject res ){
//        CorpUserDetail userDetail;
//        try {
//            System.out.println(res);
//            AuthInfo authInfo=JSONObject.parseObject(res.toJSONString(),AuthInfo.class);
//            userDetail=authHelper.login(authInfo);
//        } catch (Exception e) {
//            return Result.error(e.getMessage());
//        }
//        return Result.success(userDetail);
//    }
//
//    @GetMapping("/getJsConfig")
//    @ResponseBody
//    @WebLog(description = "鉴权接口")
//    @ApiOperation(value = "鉴权接口", notes = "{\"corpId\": \"组织id\",\"appKey\": \"appKey\"}")
//    public Result getJsConfig(HttpServletRequest request) {
//        String urlString = request.getHeader("Referer");
//        String corpId=request.getParameter("corpId");
//        String appKey=request.getParameter("appKey");
//        return Result.success(authHelper.getConfig(urlString,corpId,appKey));
//    }
//
//
//
//
//}
